<!-- 父组件 -->
<template>
{{ msg }}
    <son></son>
</template>

<script setup lang="ts">
    import { ref, reactive, onMounted, provide, watch } from "vue";
    import son from './son.vue'

    let msg = ref('张三')
    provide("msgToChild", msg)
    watch(msg, (newval)=>{
        console.log(msg.value)
    })

    

    onMounted(()=>{  })
</script>
<style scoped>
</style>